Optimal. Leaf size=111 \[ \frac{b c-a d}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac{\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^2}+\frac{x \left (a \left (c^2-d^2\right )+2 b c d\right )}{\left (c^2+d^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.153337, antiderivative size = 111, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3529, 3531, 3530} \[ \frac{b c-a d}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac{\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^2}+\frac{x \left (a \left (c^2-d^2\right )+2 b c d\right )}{\left (c^2+d^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3529
Rule 3531
Rule 3530
Rubi steps
\begin{align*} \int \frac{a+b \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx &=\frac{b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{\int \frac{a c+b d+(b c-a d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{c^2+d^2}\\ &=\frac{\left (2 b c d+a \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac{b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{\left (2 a c d-b \left (c^2-d^2\right )\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=\frac{\left (2 b c d+a \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac{\left (2 a c d-b \left (c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^2 f}+\frac{b c-a d}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))}\\ \end{align*}
Mathematica [C] time = 1.85308, size = 189, normalized size = 1.7 \[ \frac{(b c-a d) \left (\frac{2 d \left (\frac{c^2+d^2}{c+d \tan (e+f x)}-2 c \log (c+d \tan (e+f x))\right )}{\left (c^2+d^2\right )^2}+\frac{i \log (-\tan (e+f x)+i)}{(c+i d)^2}-\frac{i \log (\tan (e+f x)+i)}{(c-i d)^2}\right )+\frac{b ((-d-i c) \log (-\tan (e+f x)+i)+i (c+i d) \log (\tan (e+f x)+i)+2 d \log (c+d \tan (e+f x)))}{c^2+d^2}}{2 d f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.033, size = 301, normalized size = 2.7 \begin{align*} -{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) cd}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b{c}^{2}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b{d}^{2}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+2\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) bcd}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{ad}{f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) }}+{\frac{bc}{f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) }}+2\,{\frac{a\ln \left ( c+d\tan \left ( fx+e \right ) \right ) cd}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) b{c}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) b{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.67479, size = 239, normalized size = 2.15 \begin{align*} \frac{\frac{2 \,{\left (a c^{2} + 2 \, b c d - a d^{2}\right )}{\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac{2 \,{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{2 \,{\left (b c - a d\right )}}{c^{3} + c d^{2} +{\left (c^{2} d + d^{3}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.38805, size = 489, normalized size = 4.41 \begin{align*} \frac{2 \, b c d^{2} - 2 \, a d^{3} + 2 \,{\left (a c^{3} + 2 \, b c^{2} d - a c d^{2}\right )} f x -{\left (b c^{3} - 2 \, a c^{2} d - b c d^{2} +{\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (b c^{2} d - a c d^{2} -{\left (a c^{2} d + 2 \, b c d^{2} - a d^{3}\right )} f x\right )} \tan \left (f x + e\right )}{2 \,{\left ({\left (c^{4} d + 2 \, c^{2} d^{3} + d^{5}\right )} f \tan \left (f x + e\right ) +{\left (c^{5} + 2 \, c^{3} d^{2} + c d^{4}\right )} f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.30577, size = 325, normalized size = 2.93 \begin{align*} \frac{\frac{2 \,{\left (a c^{2} + 2 \, b c d - a d^{2}\right )}{\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac{2 \,{\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{4} d + 2 \, c^{2} d^{3} + d^{5}} + \frac{2 \,{\left (b c^{2} d \tan \left (f x + e\right ) - 2 \, a c d^{2} \tan \left (f x + e\right ) - b d^{3} \tan \left (f x + e\right ) + 2 \, b c^{3} - 3 \, a c^{2} d - a d^{3}\right )}}{{\left (c^{4} + 2 \, c^{2} d^{2} + d^{4}\right )}{\left (d \tan \left (f x + e\right ) + c\right )}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]